#ifndef DOXYGENPARSER_H
#define DOXYGENPARSER_H

#include "IDoxygenParser.h"
#include "IndexLoader.h"
#include "RefrenceItem.h"
#include "IDoxyFile.h"
#include "IDoxyClass.h"

class DoxygenParser: public IDoxygenParser
{
public:

    virtual ~DoxygenParser();
    /**
    * @brief getInstance Gets an instance of the class
    * @return An instance of the class
    */
   static QPointer<IDoxygenParser> getInstance();

   /**
    * @brief loadIndexFile Loads an doxygen index file from configuration, will remove any previously loaded index file
    * @param fileName The index file to load
    * @return True if the file has been loaded sucessfuly.
    */
   virtual bool loadIndexFile(const QString fileName);

   /**
   * @brief getFileNames Poulates the given string list with all of the files that have been processed via doxygen
   * @param FileNames A list of the file names that have been proccessed.
   */
  virtual void getFileNames(QList<RefItem>& FileNames) const;

   /**
   * @brief getClassNames Gets a list of all the classes that have been loaded by doxygen
   * @param ClassNames  A list that will be populated with all of the class names
   */
  virtual void getClassNames(QList<RefItem>& ClassNames) const;

    /**
    * @brief loadFile Only one file can be loaded at a time after another load the previous pointer will be invalidated
    * @param refId The refrence id of the file to load
    * @return A doxy file representation of the class if can be loaded, otherwise a null pointer is returned.
    */
    virtual const IDoxyFile* loadFile(QString refId);

   /**
    * @brief loadClass Load a class processed by doxygen. Note that only one class may be loaded at a time. Another load will cause the previous class to be disposed of
    * @param refId The refrence id of the class to load
    * @return A doxy representation of a class that has been processed, if NUll is returned a file has failed to be loaded.
    */
   virtual const IDoxyClass* loadClass(QString refId);






private:
    DoxygenParser();

    //single instance of the class
    static QPointer<IDoxygenParser> m_parser;
    QString m_currentWorkingPath;

    IndexLoader* m_indexLoader;
    IDoxyFile* m_doxyFile;
    IDoxyClass* m_doxyClass;


};

#endif // DOXYGENPARSER_H
